package com.dyh.quickdemo.demos.EnhanceFc;

import lombok.Getter;
import lombok.Setter;

import java.util.function.Function;

/*
@Author=Joey Wheeler
@Date=2020/10/26 15:14
*/
@Setter@Getter
public class DemoChangeLbd {
    public Function<String,String> ori;
    Function<String,String> output;

    /*
    Exception in thread "main" java.lang.StackOverflowError
	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:449)
	at java.lang.StringBuilder.append(StringBuilder.java:136)
	at com.dyh.quickdemo.demos.EnhanceFc.DemoChangeLbd.lambda$main$1(DemoChangeLbd.java:19)
	at com.dyh.quickdemo.demos.EnhanceFc.DemoChangeLbd.lambda$main$1(DemoChangeLbd.java:19)
    */
    public static void main(String[] args) {
        DemoChangeLbd demoChangeLbd = new DemoChangeLbd();
       // demoChangeLbd.setOri(s->s+"!");
        //demoChangeLbd.setOutput(s-> "$"+demoChangeLbd.getOri().apply(s));
        demoChangeLbd.ori = s->s+"!";
        Function<String,String> temp = demoChangeLbd.ori;
      //  demoChangeLbd.ori = s -> temp.apply(s)+"!";

        temp =  demoChangeLbd.ori;
       // demoChangeLbd.ori = s -> temp.apply(s)+"!";
        String res = demoChangeLbd.ori.apply("adwawd");
        System.out.println(res);
    }

}
